<include file="__THEME__/header" />

<div class="content pada20"><!-- 内容 begin  --> 
  <div class="main no_l">
    <div class="mainbox">
      <div class="mainbox_C no_r boxMessage">
      <div class="tab-menu">
        <div class="right pt10"><a href="javascript:void(0)" onclick="postMessage();">发私信</a></div>
        <ul>
          <li><a class="feed_item <eq name="type" value="inbox">on</eq>"  href="{:U('home/Message/inbox')}" ><span>收件箱</span></a></li>
          <li><a class="feed_item <eq name="type" value="outbox">on</eq>" href="{:U('home/Message/outbox')}"><span>发件箱</span></a></li>
        </ul>
      </div>

      <div class=""> 
        <ul class="feed_list">
        <li>
            <eq name="type" value="inbox">
            <a href="{:U('home/Message/inbox')}" class="right"><< 返回收件箱</a>
            <else/>
            <a href="{:U('home/Message/outbox')}" class="right"><< 返回发件箱</a>
            </eq>
            <span>我和宝明的私信(共3封私信)</span>
        </li>
         <!-- 快速回复 -->
         <li id="message_reply mt10">
             <div style="margin-left:70px">
	             <div class="msgCnt" style="padding-bottom:0;"> 
                 <strong>发私信给:</strong>
                   <space uid="ts['user']['uid']" class="fn" target="_blank">{uname}</space>
				   <div class="mt5">
                     <div class="right"><space uid="ts['user']['uid']" target="_blank">{uavatar=m}</space></div>
                     <div style="margin-right:70px;overflow:hidden">
                     <textarea id="reply_content" style="width: 98%;" rows="5" cols="" onblur="this.className='text_massage'" onfocus="this.className='text_massage_on'" class="text_massage"></textarea>
                     <div><input type="button" value="发送" class="btn_b mt5 right" onclick="doReply();"/>表情</div>
                     </div>
                   </div>
	             </div>
             </div>
         </li>
        <!-- 会话列表 -->
        <volist name="message" id="vo">
        <li class="lineD_btm <php>if($type=='inbox' && $vo['to_uid']==$ts['user']['uid'] && $vo['is_read']==0){</php>bg_warning<php>}</php>">
            <div class="userPic"><space uid="vo.from_uid" target="_blank">{uavatar=m}</space></div>
            <div class="feed_massage">
                <div class="msgCnt" style="padding-bottom:0;">
                    <!--文涛修改-->
                    <!--<div class="lineS_btm"><a href="javascript:void(0);">{$vo.title}</a></div>私信标题-->
                    <space uid="vo.from_uid" class="fn" target="_blank">{uname}:</space>
                    <span>{$vo.content|formatComment=###,true}</span>
                    <div class="line_massage"><a href="#" class="right">回复</a><em class="date">{$vo.ctime|date="Y-m-d H:i:s",###}</em></div>
                </div>
            </div>
         </li>
         </volist>
        </ul>
      </div>
      <div class="c"></div>
    </div>
  </div>
  <div class="clear"></div>
</div>
</div>
<!-- 内容 end --> 

<script type='text/javascript'>
    function doReply() {
        var reply_content = $('#reply_content').val();
        var message_id    = "{$message[0]['source_message_id']}";
        $.post("{:U('home/Message/doReply')}", {message_id:message_id, reply_content:reply_content}, function(res){
            if(res == '1') {
                $('#reply_content').val('');
                ui.success('发送成功');
                //window.location.reload();
            }else {
                ui.error('发送失败');
            }
        });
    }
    
    function postMessage() {
        ui.box.load("{:U('home/Message/post')}", {title:'发私信'});
    }
</script> 
<include file="__THEME__/footer" /> 